package com.ilink.ilinkcommon.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.sql.Timestamp;
import java.util.Date;
import javax.validation.constraints.NotEmpty;
import lombok.Data;

@Data
@TableName("tb_user")
public class User {

    @TableId(value = "user_id", type = IdType.INPUT)
    //private String userId = UUID.randomUUID().toString();
    private String userId;

    @NotEmpty
    private String username;

    @NotEmpty
    private String password;

    private String schoolName;

    private String schoolId;

    private String nickname;

    private String email;

    private Timestamp createdAt;
    //    @TableField("userIntroduction")
    private String userIntroduction;
    //    @TableField("userImage")
    private String userImage;
    //    @TableField("userCollege")
    private String userCollege;
    private String realname;
    private String sex;
    //    private String userStudentNumber;
    @TableField("userGrade")
    private String userGrade;
    @TableField("userMajor")
    private String userMajor;
    @TableField("userMobile")
    private String userMobile;
    @TableField("userCover")
    private String userCover;
    private String userType;
    @TableField("last_login_at")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date lastLoginAt;
    //所属校区
    private String userCampus;
    //在校生身份
    private String studentStatus;
    //入学年份
    private String enrollmentYear;


    public User() {
    }

    public User(@NotEmpty String username, @NotEmpty String password) {
        this.username = username;
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
            "userId='" + userId + '\'' +
            ", username='" + username + '\'' +
            ", password='" + password + '\'' +
            ", schoolName='" + schoolName + '\'' +
            ", schoolId='" + schoolId + '\'' +
            ", nickname='" + nickname + '\'' +
            ", email='" + email + '\'' +
            ", createdAt=" + createdAt +
            ", userIntroduction='" + userIntroduction + '\'' +
            ", userImage='" + userImage + '\'' +
            ", userCollege='" + userCollege + '\'' +
            ", realname='" + realname + '\'' +
            ", sex='" + sex + '\'' +
            ", userGrade='" + userGrade + '\'' +
            ", userMajor='" + userMajor + '\'' +
            ", userMobile='" + userMobile + '\'' +
            ", userCover='" + userCover + '\'' +
            ", userType='" + userType + '\'';
    }
}
